<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 基本表单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="__PUBLIC__/admin/favicon.ico"> <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">

</head>
<!--<include file="Admin@Index:cache" />-->
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">

        <div class="col-sm-6" style="width:70%;left:15%">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>参数设置</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal">
                        <div class="form-group">
                           <label class="col-sm-3 control-label" >每日利息（万分之）：</label>

                            <div class="col-sm-8">
                                <input type="number" min="0" id="interest" placeholder="每日利息" value="<{$data.day_interest}>" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                           <label class="col-sm-3 control-label" >砍头息（百分之）：</label>

                            <div class="col-sm-8">
                                <input type="number" min="0" id="font_interest" placeholder="砍头息" value="<{$data.font_interest}>" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label" >每日滞纳金（万分之）：</label>

                            <div class="col-sm-8">
                                <input type="number" min="0" id="overdue_money" placeholder="每日滞纳金" value="<{$data.late_fee}>" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">结束计算滞纳金天数（天）：</label>
                            <div class="col-sm-8">
                                <input type="number" min="1" id="overdue_day" placeholder="结束计算滞纳金天数" value="<{$data.late_days}>" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">借款周期（天）：</label>
                            <div class="col-sm-8">
                                <input type="number" min="1" id="borrowing_cycle" placeholder="结束计算滞纳金天数" value="<{$data.borrowing_cycle}>" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-8">
                                <button class="btn btn-sm btn-info" type="submit" id="sub">添 加</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>


</div>



<!-- 全局js -->
<script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>

<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/admin/js/plugins/layer/layer.min.js"></script>
<!-- iCheck -->
<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    });
    $('#sub').on('click',function(){
        var interest=$('#interest').val();
        var font_interest=$('#font_interest').val();
        var overdue_money=$('#overdue_money').val();
        var overdue_day=$('#overdue_day').val();
        var borrowing_cycle=$('#borrowing_cycle').val();
        if(interest==''){
            layer.alert('利息不能为空');
            return false;
        }
        if(font_interest==''){
            layer.alert('利息不能为空');
            return false;
        }
        if(overdue_money==''){
            layer.alert('每日滞纳金不能为空');
            return false;
        }
        if(overdue_day==''){
            layer.alert('天数不能为空');
            return false;
        }
        if(borrowing_cycle==''){
            layer.alert('借款周期不能为空');
            return false;
        }
        if(overdue_day<0 || interest<0 || overdue_money<0){
            layer.alert('请输入正确数值');
            return false;
        }
        $.post('__MODULE__/Systems/merchant_param',{interest:interest,overdue_money:overdue_money,overdue_day:overdue_day,borrowing_cycle:borrowing_cycle,font_interest:font_interest},function(data){
            if(data.code=='1001'){
                window.location.reload();
            }else{
                if(data.status=='0'){
                    layer.alert(data.info);
                }else{
                    layer.alert(data.result);
                }
            }
        });
    });
</script>




</body>

</html>
